package controller
{
	import flash.events.EventDispatcher;
	
	import mx.controls.Alert;
	public class ControllerManager  extends BaseController
	{
		// static instance 
		protected static var instance:ControllerManager = null;
		// 0 lobby
		// 1 ,join room
		//2,i'm ready
		//3 ,playing game
		public var state:int;
		public var isDebug:Boolean=false;
		public function debug(msg:String,mustTrace:Boolean=false,mustDebug:Boolean=false):void{
			if(isDebug||mustDebug){
			Alert.okLabel = "确定";
			Alert.show(msg, "debug", Alert.OK, null, null);
			}
			if(mustTrace){
				trace(msg);
			}
		}
		public function ControllerManager()
		{
			if ( instance != null )
				throw new Error( "Only one Singleton instance should be instantiated" ); 
		}
		static public function get Instance():ControllerManager
		{
			if ( instance == null )
				instance = new ControllerManager();
			return instance;
		}
	}
}